#ifndef __MEM_MALLOC_H__
#define __MEM_MALLOC_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h> 
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

#define MUTI_MEM_AERA

#pragma pack(4)
typedef struct _mem_param {
    char*    mem_start;
    char*	mem_end;
    unsigned int	mem_size;
}mem_param_t;

typedef struct _mem_block{ 
    char			*mem_ptr;  
    unsigned int	mem_size; 
    unsigned int	mem_index;    
}mem_block_t;
#pragma pack()



void print_mem_info(void);
void print_hex(char *data, int len);
void print_mem_hex(int size);

//int mem_free(void *ptr);
//void* mem_malloc(size_t msize);

#ifndef MUTI_MEM_AERA
int mem_malloc_ex(unsigned int msize);
int mem_realloc(int id, unsigned int msize);
int mem_free_ex(int id);
void* mem_buffer(int id);
#else
int mem_malloc_ex(uint8_t area_id,unsigned int msize);
int mem_realloc(uint8_t area_id,int id, unsigned int msize);
int mem_free_ex(uint8_t area_id,int id);
void* mem_buffer(uint8_t area_id,int id);
#endif

#ifdef __cplusplus
}
#endif

#endif